//
//  LSZPrayerAndTestimonyManager.m
//  JKFuYinProject
//
//  Created by 九酷 on 2017/12/20.
//  Copyright © 2017年 LC. All rights reserved.
//

#import "LSZPrayerAndTestimonyManager.h"

@implementation LSZPrayerAndTestimonyManager
-(id)initWithPrayerAndTestimony:(NSDictionary *)dic  
{
    self = [super init];
    if (self) {
        self.mutMgArray  = [[NSMutableArray alloc]init];
        if ([[dic valueForKey:@"data"] isKindOfClass:[NSString class]]) {
            return self;
        }
        if ([[dic valueForKey:@"data"] isKindOfClass:[NSNumber class]]) {
            return self;
        }
        if (![dic valueForKey:@"data"]) {
            return self;
        }
        NSArray * arrayData = dic[@"data"];
        NSMutableArray * arrayMg = [[NSMutableArray alloc]init];
        for (NSDictionary * dicmutData in arrayData) {
            LSZPrayerAndTestimonyMg * mg = [[LSZPrayerAndTestimonyMg alloc]init];
            mg.id_id          = NullStringjudgment(NSStr(dicmutData[@"id"]));
            mg.uid           = NullStringjudgment(NSStr(dicmutData[@"uid"]));
            mg.publisher      = NullStringjudgment(NSStr(dicmutData[@"publisher"]));
            mg.publisher_pic  = NullStringjudgment(NSStr(dicmutData[@"publisher_pic"]));
            mg.imageUrl       = NullStringjudgment(NSStr(dicmutData[@"imageUrl"]));
            mg.title          = NullStringjudgment(NSStr(dicmutData[@"title"]));
            mg.toName         = NullStringjudgment(NSStr(dicmutData[@"toName"]));
            mg.type           = NullStringjudgment(NSStr(dicmutData[@"type"]));
            mg.typeName       = NullStringjudgment(NSStr(dicmutData[@"typeName"]));
            mg.content        = NullStringjudgment(NSStr(dicmutData[@"content"]));
            mg.createTime     = [LSZSpecialPackaging GetThePreviousTime1970:NullStringjudgment(NSStr(dicmutData[@"createTime"]))];
            mg.browseNum      = NullStringjudgment(NSStr(dicmutData[@"browseNum"]));
            mg.commentNum     = NullStringjudgment(NSStr(dicmutData[@"commentNum"]));
            mg.praiseNum      = NullStringjudgment(NSStr(dicmutData[@"praiseNum"]));
            mg.location      = NullStringjudgment(NSStr(dicmutData[@"location"]));
            mg.gender      = NullStringjudgment(NSStr(dicmutData[@"gender"]));
            mg.is_follow      = NullStringjudgment(NSStr(dicmutData[@"is_follow"]));

            [arrayMg addObject:mg];
        }
        self.mutMgArray = arrayMg;
    }
    return self;
}
-(id)initWithPrayerAndTestimonyArray:(NSArray *)arrayData
{
    self = [super init];
    if (self) {
        self.mutMgArray  = [[NSMutableArray alloc]init];
        NSMutableArray * arrayMg = [[NSMutableArray alloc]init];
        for (NSDictionary * dicmutData in arrayData) {
            LSZPrayerAndTestimonyMg * mg = [[LSZPrayerAndTestimonyMg alloc]init];
            mg.id_id          = NullStringjudgment(NSStr(dicmutData[@"id"]));
            mg.publisher      = NullStringjudgment(NSStr(dicmutData[@"publisher"]));
            mg.publisher_pic  = NullStringjudgment(NSStr(dicmutData[@"publisher_pic"]));
            mg.imageUrl       = NullStringjudgment(NSStr(dicmutData[@"imageUrl"]));
            mg.title          = NullStringjudgment(NSStr(dicmutData[@"title"]));
            mg.toName         = NullStringjudgment(NSStr(dicmutData[@"toName"]));
            mg.type           = NullStringjudgment(NSStr(dicmutData[@"type"]));
            mg.typeName       = NullStringjudgment(NSStr(dicmutData[@"typeName"]));
            mg.content        = NullStringjudgment(NSStr(dicmutData[@"content"]));
            mg.createTime     = [LSZSpecialPackaging GetThePreviousTime1970:NullStringjudgment(NSStr(dicmutData[@"createTime"]))];
            mg.browseNum      = NullStringjudgment(NSStr(dicmutData[@"browseNum"]));
            mg.commentNum     = NullStringjudgment(NSStr(dicmutData[@"commentNum"]));
            mg.praiseNum      = NullStringjudgment(NSStr(dicmutData[@"praiseNum"]));
            mg.location      = NullStringjudgment(NSStr(dicmutData[@"location"]));
            mg.gender      = NullStringjudgment(NSStr(dicmutData[@"gender"]));
            mg.is_follow      = NullStringjudgment(NSStr(dicmutData[@"is_follow"]));
            [arrayMg addObject:mg];
        }
        self.mutMgArray = arrayMg;
    }
    return self;
}
@end
@implementation LSZPrayerAndTestimonyMg
@end
